//获取应用实例
const app = getApp()

Page({
  data: {
    allAdmin:'',
    classAdmin:'',
    isBankAdmin:'',
    headers:'',
    name:'',
    uId:''
  },

  router(e){
    let url = e.currentTarget.dataset.url
    wx.navigateTo({
      url: `${url}?uId=${this.data.uId}`
    }) 
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad (options) {
    if( !!options && options.isBankAdmin ) {
      this.setData({
        isBankAdmin: options.isBankAdmin
      })

      this.setData({
        headers: options.avatarUrl
      })

      this.setData({
        name: options.name
      })

      this.setData({
        uId: options.uId
      })
    }
    
    this.setData({
      allAdmin: app.globalData.allAdmin
    })

    this.setData({
      classAdmin: app.globalData.classAdmin
    })

  }
})